<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>

<!DOCTYPE html>
<html lang="en">
<head>
    <base href="<%=basePath%>">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    <title>Document</title>
</head>
<body>


    <form class="layui-form" lay-filter="taskForm" id="taskForm" action="" style="padding:15px 10px;">
        <input type="hidden" name="id">
        <input type="hidden" name="solvers">
        <input type="hidden" name="bugIdStr">
        <div class="layui-form-item">
            <label class="layui-form-label">任务编号:</label>
            <div class="layui-input-inline">
                <input type="text" name="solveTaskCode" required  lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
            </div>
            <label class="layui-form-label">任务名称:</label>
            <div class="layui-input-inline">
                <input type="text" name="solveTaskName" required  lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">工作单据:</label>
            <div class="layui-input-inline">
                <select name="workDocTypeId" id="workDoc" width="300px" lay-filter="workDoc">
                    <option value="-1">请选择</option>
                </select>
            </div>
            <label class="layui-form-label">任务负责人:</label>
            <div class="layui-input-inline">
                <select name="taskManagerId" id="taskManagerCode" width="300px" lay-filter="taskManagerCode">
                    <option value="-1">请选择</option>
                </select>
            </div>
        </div>
        
        <div class="layui-form-item">
            <label class="layui-form-label">下发人:</label>
            <div class="layui-input-block">
                <input type="text" value="${sessionScope.login_user.username}" name="issuedByName" class="layui-input" readonly style="border: 0px;">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">下发日期:</label>
            <div class="layui-input-block">
                <input type="text" class="layui-input" disabled id="issuedTime" name = "time">
                <input type="hidden" name="datetime" value="">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">任务描述:</label>
            <div class="layui-input-block">
                <textarea name="taskDesc" cols="50" rows="5"></textarea>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">备注:</label>
            <div class="layui-input-block">
                <textarea name="common" id="" cols="50" rows="5"></textarea>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">消缺员:</label>
            <div class="layui-input-block">
                <select name="solverStr" class="layui-select" id="solverStr" xm-select="solver" width="300px">
                    <option value="-1">请选择</option>
                </select>
            </div>
        </div>
    </form>
        <div class="layui-form-item">
            <table class="layui-table" id="bugTable" lay-filter="bugTable"></table>
        </div>


    <script>
        layui.form.render();
        layui.use(['laydate','table','form'],function () {
            var laydate = layui.laydate;
            laydate.render({
                elem: '#issuedTime'
                ,value: new Date()
                ,isInitValue: true
            });

            //渲染表格
            var table = layui.table;
            table.render({
                id:'bugTable',
                elem:'#bugTable',
                url:'/solveTaskMain/getBug',
                even:false,
                cols:[[
                    {type:'checkbox'},
                    {field:'lineCode', title:'线路编号'},
                    {field:'poleCode', title:'杆塔编号'},
                    {field:'bugLevelName', title:'缺陷级别'},
                    {field:'bugTypeName', title:'缺陷类型'},
                    {field:'bugDesc', title:'缺陷描述'},
                    {field:'discovererName', title:'发现人'},
                    {field:'discoverTime', title:'发现时间'},
                ]]
            })
        });
        var time = $(":input[name = 'time']").val();
        $(":input[name = 'datetime']").val(time);
        layui.formSelects.render();
    </script>
</body>
</html>
